from fastapi import Request
from fastapi import APIRouter

from app.schemas.base import Success
from app.schemas.users import *
from app.log.log import logger


router = APIRouter()


@router.post("/kafka/send/{message}", summary="Kafka 生产者测试发送消息")
async def list_user(
    message: str,
    request: Request
):
    await request.app.state.kafka_producer.send("test_topic", value=message)
    return Success(msg="send success")